<template>
    <view>
        <view class="cu-list menu sm-border card-menu margin-top">
            <view class="cu-item arrow " @click="jumpClick" data-link="/pages/creator/notice/notice" data-modul="1">
                <view class="content ">
                    <text class="cuIcon-notice text-blue "></text>
                    <text class="text-black ">通知消息</text>
                </view>
				<view class=" cuIcon-title text-red " v-if="noticeCount > 0">
					
				</view>
            </view>
			
			<!---->
			<view class="cu-item arrow" @click="jumpClick" data-link="/pages/creator/invitation/record" data-modul="1">
			    <view class="content">
			        <text class="cuIcon-friend text-blue"></text>
			        <text class="text-black">邀请记录</text>
			    </view>
			</view>

            <view class="cu-item arrow" @click="jumpClick" data-link="/pages/creator/upload/upload" data-modul="2">
                <view class="content">
                    <text class="cuIcon-upload text-blue"></text>
                    <text class="text-black">上传素材</text>
                </view>
            </view>
			
			<view class="cu-item arrow" @click="jumpClick" data-link="/pages/webview/webview" data-modul="2">
			    <view class="content">
			        <text class="cuIcon-upload text-blue"></text>
			        <text class="text-black">H5上传</text>
			    </view>
			</view>
            <view class="cu-item arrow" @click="jumpClick" data-link="/pages/creator/wallpaper/wallpaper" data-modul="3">
                <view class="content">
                    <text class="cuIcon-circle text-blue"></text>
                    <text class="text-black">素材管理</text>
                </view>
                <view class="action">
                    <text class="text-grey text-sm">{{ count }}张</text>
                </view>
            </view>

            <view class="cu-item arrow" @click="jumpClick" data-link="/pages/creator/record/record" data-modul="4">
                <view class="content">
                    <text class="cuIcon-moneybag text-blue"></text>
                    <text class="text-black">收益管理</text>
                </view>
            </view>
			
			
			<view class="cu-item arrow" @click="jumpClick" data-link="/pages/creator/userinfo/userinfo" data-modul="4">
			    <view class="content">
			        <text class="cuIcon-friendfamous text-blue"></text>
			        <text class="text-black">个人资料</text>
			    </view>
			</view>
			
			<view class="cu-item arrow" @click="copyContact" >
			    <view class="content">
			        <text class="cuIcon-weixin text-blue"></text>
			        <text class="text-black">联系方式</text>
			    </view>
			</view>
			
            <view class="cu-item">
				<view class="content padding-tb-sm">
					<view>
						<text class="cuIcon-infofill text-red margin-right-xs">
						</text>
						温馨提示：
					</view>
					<view class="text-gray text-sm">
						<text class="margin-right-ls"></text> 
						为了各位创作者方便，创作中心已迁移至微信小程序，
						请查看通知消息中的“微信小程序创作者中心开放”的详细内容。
						并且在个人资料中完善个人手机号码，用于在微信小程序端登录，
						如有不明白处，请联系平台负责人。
						</view>
						<text class="margin-right-ls"></text>
						后续将会关闭抖音创作者中心，请大家及时完善信息，前往微信端
						</view>
					</view>
				
			</view>
        </view>
    </view>
</template>

<script>
// d:\applet\byteApplet\dy-wallpaper-applet-2\pages\creator\creator.js

const util = require('../../utils/util.js');

const http = require('../../utils/http.js');

export default {
    data() {
        return {
            count: 0,
            sumMoney: 0,
            yesterdayMoney: 0,
			noticeCount:0,
			configs:[],
        };
    },
    onLoad: function (options) {
		//this.centerProfit();
		this.getDateSub3();
		util.getConfigs(this,"wx");
	},
    onShow: function () {
        this.getMyCount();
    },
    methods: {
		copyContact: function (e) {
		
		    uni.setClipboardData({
		        data: this.configs[0].value,
		        success: function (res) {
		            uni.showToast({
		                title: '复制成功',
		                duration: 2000,
						icon:'none',
		                success(res) {},
		            
		                fail(res) {}
		            });
		        }
		    });
		},
        getMyCount: function () {
            let that = this;
            var params = {
                url: '/u/my/getMyCount',
                method: 'GET',
                data: {
                   
                },
                callBack: function (res) {
                    that.setData({
                        count: res.data
                    });
                }
            };
            http.request(params);
        },
		getDateSub3: function () {
		    let that = this;
		    var params = {
		        url: '/notice/getDateSub3',
		        method: 'GET',
		        data: {},
		        callBack: function (res) {
		            that.setData({
		                noticeCount: res.data
		            });
		        }
		    };
		    http.request(params);
		},

        /**
         * 获取收益
         */
        centerProfit: function () {
            let that = this;
            var params = {
                url: '/p/balance/centerProfit',
                method: 'GET',
                data: {
                },
                callBack: function (res) {
                    if(res.code == 200){
						that.setData({
						    sumMoney: res.data.sumMoney,
						    yesterdayMoney: res.data.yesterdayMoney
						});
					}
                }
            };
            http.request(params);
        },

        jumpClick: function (e) {
            let link = e.currentTarget.dataset.link;
            let modul = e.currentTarget.dataset.modul;
            uni.navigateTo({
                url: link,
                // 指定页面的 url
                success: (res) => {},
                fail: (res) => {}
            });
        }
    }
};
</script>
<style>
@import './creator.css';
</style>
